<div class="ref_menu">
  <ul>
    <li class="sep_line first"> <img src="templates/mwc/images/img_website.png" width="52" alt="Website Referencer" /><a class="ref_menu_link" href="index.php?option=com_content&view=article&layout=websitereferencer&id=27&Itemid=11">Website Referencer</a> </li>
	 <li class="sep_line"> <img src="templates/mwc/images/img_webshop_small.png" width="66" alt="Webshop Referencer" /> <a class="ref_menu_link" href="index.php?option=com_content&view=article&layout=webshopreferencer&id=28&Itemid=11">Webshop Referencer</a> </li>
    <li class="sep_line"> <img src="templates/mwc/images/img_portal_small.png" width="46" alt="Portal Referencer" /> <a class="ref_menu_link" href="index.php?option=com_content&view=article&layout=portalreferencer&id=29&Itemid=11">Portal Referencer</a> </li>
    <li class="last"> <img src="templates/mwc/images/img_flash.png" width="53" alt="Flash banner" /> <a class="ref_menu_link" href="index.php?option=com_content&view=article&layout=flashbannerreferencer&id=35&Itemid=11">Flash banner</a> </li>
  </ul>
</div>
<div class="referencer_ctn">
  <?php 
  function getPopup($filename){
  	$arr_filename = explode(".",$filename);
	if(count($arr_filename)){
		$name = $arr_filename[0] . "_popup";
		return $name . "." . $arr_filename[1];
	}
	return $filename;
  }
  $i = 1;
  foreach($data as $key=>$value){?>
  <div class="ref_item <?php if($i%3==0){?> third_item<?php } ?>">
    <div class="ref_illus"><a rel="example_group" href="images/phocagallery/<?php echo getPopup($value["filename"]);?>" title="<?php echo $value["title"];?>"><img src="images/phocagallery/<?php echo $value["filename"];?>" alt="<?php echo $value["title"];?>" width="275" height="175"/></a></div>
    <div class="ref_link_ctn"><a href="<?php echo $value["title"];?>"  target="_blank"><?php echo $value["title"];?> </a></div>
  </div>
  <?php if($i%3==0){?>
  <div class="ref_sep"><span></span></div>
  <?php } 
  $i++;
  ?>
  <?php } ?>
</div>
<div id="pager"> <?php echo $link;?> </div>
